Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
lodash.kebabcase
Advanced tools
The lodash.kebabcase package is a utility function that converts a given string to kebab-case. Kebab-case is a string format where words are lowercased and separated by hyphens.
Basic Conversion
This feature converts a simple string with spaces into kebab-case.
const kebabCase = require('lodash.kebabcase');
console.log(kebabCase('Hello World')); // Output: 'hello-world'
Conversion with Special Characters
This feature handles special characters and converts them into kebab-case.
const kebabCase = require('lodash.kebabcase');
console.log(kebabCase('Hello_World!')); // Output: 'hello-world'
Conversion with Mixed Case
This feature converts camelCase strings into kebab-case.
const kebabCase = require('lodash.kebabcase');
console.log(kebabCase('helloWorld')); // Output: 'hello-world'
The change-case package provides a variety of string case transformations, including kebab-case. It is more versatile than lodash.kebabcase as it supports multiple case transformations like camelCase, snake_case, and more.
The param-case package is specifically designed to convert strings to kebab-case. It is similar to lodash.kebabcase but is more focused and lightweight, making it a good alternative if you only need kebab-case conversion.
The to-case package offers multiple string case transformations, including kebab-case. It is similar to change-case but with a simpler API, making it easier to use for basic transformations.
The lodash method _.kebabCase
exported as a Node.js module.
Using npm:
$ {sudo -H} npm i -g npm
$ npm i --save lodash.kebabcase
In Node.js:
var kebabCase = require('lodash.kebabcase');
See the documentation or package source for more details.
FAQs
The lodash method `_.kebabCase` exported as a module.
The npm package lodash.kebabcase receives a total of 3,314,014 weekly downloads. As such, lodash.kebabcase popularity was classified as popular.
We found that lodash.kebabcase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.